﻿using System;
using biz.ritter.javapi.lang;
using Nofs.Net.Annotations;

namespace Nofs.Net.AnnotationDriver
{
    public class DomainObjectAttribute :  Attribute, IDomainObject
    {
        public DomainObjectAttribute()
            :base()
        {
        }

        /// <summary>
        /// Tells NOFS if the domain object can be written to
        ///@return	True if the domain object can be altered by NOFS, false if not
        /// </summary>
        /// <returns></returns>
        public bool CanWrite()
        {
            //default true;
            return true;
        }

        /**
         * Tells NOFS the type of the class that manages block layout if such a class exists
         * @return	By default, this resolves to Object.class which acts as a NULL value. It can be set to an object that is marked as a layout object.
         */
        public Class LayoutObject()
        {
            // default Object.class;
            return typeof(Object).getClass();
        }

        public Type LayoutType()
        {
            return typeof(object);
        }
    }
}
